package sort.record;

/**
 * @author masaru-gotou
 *
 */
public class RandomRecordsFactory implements RecordsFactory {
	private static RandomRecordsFactory instance = new RandomRecordsFactory();
	
	private RandomRecordsFactory() {}
	
	public static RandomRecordsFactory getInstance() {
		return instance;
	}
	
	public Records create(int num) {
		Records recs = new Records();
		for ( int i=0; i<num; i++) {
			int rand =(int)(Math.random()*num);
			int rand2 =(int)(Math.random()*num);
			recs.add(new Record(rand,"test"+rand2));
		}
		return recs;
	}

	public Records create() {
		return create(10);
	}
}
